package br.com.upper.entity;

import java.util.ArrayList;
import java.util.List;

public enum VolumeType {
	
	STANDARD(0, "Standard"),
	PROVISIONED_IOPS(1, "Provisioned IOPs");
	
	private Integer value;
	private String name;
	
	private VolumeType(Integer value, String name) {
		this.value = value;
		this.name = name;
	}

	public Integer getValue() {
		return value;
	}

	public String getName() {
		return name;
	}
	
	public static VolumeType getVolumeType(Integer value) {
		VolumeType volumeType = null;
		
		if(value.equals(STANDARD.getValue())) {
			volumeType = STANDARD;
		} else if (value.equals(PROVISIONED_IOPS.getValue())) {
			volumeType = PROVISIONED_IOPS;
		}		
		return volumeType;		
	}
	
	public static List<VolumeType> getVolumeTypes() {
		List<VolumeType> volumeTypes = new  ArrayList<VolumeType>();
		
		for(VolumeType volumeType : values()) {
			volumeTypes.add(volumeType);
		}				
		return volumeTypes;
	}
	
}
